//
//  CYDiscoverTitleCell.m
//  cyjf
//
//  Created by tauCross on 2017/11/28.
//  Copyright © 2017年 Auto Financing. All rights reserved.
//

#import "CYDiscoverTitleCell.h"



@implementation CYDiscoverTitleCellObject

@end



@interface CYDiscoverTitleCell ()

@property(nonatomic, strong)UILabel *titleLabel;

@end


@implementation CYDiscoverTitleCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self)
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.text = @"近期活动";
        self.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
        self.titleLabel.textColor = HEXCOLOR(@"444444");
        [self.titleLabel sizeToFit];
        [self.contentView addSubview:self.titleLabel];
    }
    return self;
}

+ (CGFloat)heightForObject:(id)object atIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
    return 42;
}

- (BOOL)shouldUpdateCellWithObject:(id)object
{
    [self setNeedsLayout];
    return YES;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.titleLabel.left = 20;
    self.titleLabel.centerY = 26;
}

@end
